<script setup>
const circleUrl = 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'
import { SwitchButton} from "@element-plus/icons-vue";
</script>

<template>
  <div class="main">
    <div class="container w">
      <el-container>
        <el-header>
          <div class="img-div">
            <img src="@/assets/img/logo.png" alt="" class="img">
          </div>
          <div class="avatar-div">

            <el-dropdown
              trigger="click"
            >
              <el-avatar :size="50" :src="circleUrl"/>
              <template #dropdown>
                <el-dropdown-menu>
                  <el-dropdown-item @click="logout">
                    <el-icon>
                      <SwitchButton/>
                    </el-icon>
                    <span>退出登录</span>
                  </el-dropdown-item>
                </el-dropdown-menu>
              </template>
            </el-dropdown>
          </div>
        </el-header>
        <el-container>
          <el-aside width="200px">
            <el-menu router class="custom-sidebar" :default-active="$route.path">
              <el-menu-item index="/apply/reimburse">
                <template #title>
                  <i class="el-icon-house mr-2"></i>
                  <span>报销管理</span>
                </template>
              </el-menu-item>
              <el-menu-item index="/apply/">
                <template #title>
                  <i class="el-icon-house mr-2"></i>
                  <span>差旅申请</span>
                </template>
              </el-menu-item>
              <el-menu-item index="/apply/manage">
                <template #title>
                  <i class="el-icon-house mr-2"></i>
                  <span>差旅管理</span>
                </template>
              </el-menu-item>

            </el-menu>
          </el-aside>
          <el-main>
            <router-view/>
          </el-main>
        </el-container>
      </el-container>
    </div>
  </div>
</template>

<style scoped lang="scss">


.main {
  min-height: 100vh;
  background-color: #e6ecfe;
}

.container .w {
  max-width: 1400px;
  margin: 0 auto;
}


.el-header {
  background: rgba(10, 25, 47, 0.9);
  height: 70px;
  border-radius: 10px 10px 0 0;
  display: flex;
  justify-content: space-between;


  .img-div {
    margin-top: 10px;
    margin-left: -10px;
  }

  .img {
    width: 180px;
  }

  .avatar-div {
    margin-top: 10px;
    margin-right: 10px;
  }


}

.el-aside {
  background: rgba(10, 25, 47, 0.9);
}

.custom-sidebar {
  background: transparent;
  border: none;
  padding: 20px 0;
}

.custom-sidebar .el-menu-item {
  color: #ffffff;
  height: 56px;
  line-height: 56px;
  margin: 8px 12px;
  border-radius: 8px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.custom-sidebar .el-menu-item:hover {
  background: rgba(100, 255, 218, 0.1);
  color: #64ffda;
}

.custom-sidebar .el-menu-item.is-active {
  background: rgba(100, 255, 218, 0.15);
  color: #64ffda;
  font-weight: 500;
}

.custom-sidebar .el-menu-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 3px;
  background: #64ffda;
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.custom-sidebar .el-menu-item.is-active::before {
  transform: scaleY(1);
}

.custom-sidebar .el-icon-house {
  color: #64ffda;
  font-size: 18px;
}

.mr-2 {
  margin-right: 8px;
}

.el-main {
  padding: 30px;
  min-height: 600px;
}

.router-content {
  border-radius: 8px;
  padding: 30px;
  border: 1px solid rgba(100, 255, 218, 0.1);
}

.router-content h2 {
  color: #64ffda;
  margin-bottom: 20px;
  font-weight: 600;
  border-bottom: 1px solid rgba(100, 255, 218, 0.2);
  padding-bottom: 10px;
}

.router-content p {
  line-height: 1.8;
  margin-bottom: 15px;
}


</style>
